<?php

namespace backend\modules\marketing\models;

use Yii;

/**
 * This is the model class for table "share_reb".
 *
 * @property string $share_reb_id
 * @property string $user_id
 * @property string $buyer_id
 * @property string $reb_money
 * @property integer $created_at
 * @property string $goods_id
 * @property string $order_id
 * @property string $is_payed
 * @property string $goods_number
 */
class ShareReb extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'share_reb';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['share_reb_id', 'user_id', 'buyer_id', 'created_at', 'goods_id'], 'required'],
            [['reb_money'], 'number'],
            [['created_at','is_payed','goods_number'], 'integer'],
            [['share_reb_id','user_id', 'buyer_id', 'goods_id', 'order_id'], 'string', 'max' => 40],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'share_reb_id' => Yii::t('app', 'Share Reb ID'),
            'user_id' => Yii::t('app', 'User ID'),
            'buyer_id' => Yii::t('app', 'Buyer ID'),
            'reb_money' => Yii::t('app', 'Reb Money'),
            'created_at' => Yii::t('app', 'Created At'),
            'goods_id' => Yii::t('app', 'Goods ID'),
            'order_id'=> Yii::t('app', 'Goods ID'),
        ];
    }

    /**
     * @inheritdoc
     * @return \backend\modules\marketing\models\query\ShareRebQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new \backend\modules\marketing\models\query\ShareRebQuery(get_called_class());
    }
}
